<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <base href="<%=basePath%>"/>
    
    <title>厦大植物检索与交流系统</title>
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>    
	<meta http-equiv="keywords" content="厦大,植物检索,"/>
	<meta http-equiv="description" content="厦大植物检索与交流系统"/>
	<link rel="stylesheet" type="text/css" href="css/common.css"/>
	<link rel="stylesheet" type="text/css" href="css/replylist.css"/>
	<link rel="stylesheet" type="text/css" href="css/jquery.ui.all.css"/>
	<link rel="stylesheet" type="text/css" href="css/jquery-ui-1.7.3.custom.css"/>
	
	<link rel="stylesheet" href="kindeditor/themes/default/default.css" />
	<link rel="stylesheet" href="kindeditor/plugins/code/prettify.css" />
	<script charset="utf-8" src="kindeditor/kindeditor.js"></script>
	<script charset="utf-8" src="kindeditor/lang/zh_CN.js"></script>
	<script charset="utf-8" src="kindeditor/plugins/code/prettify.js"></script>
	
	<script type="text/javascript" language="javascript" src="js/jquery-1.7.1.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.dropdown.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.core.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.widget.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.mouse.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.button.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.bgiframe-2.1.2.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.draggable.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.position.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.ui.dialog.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.effects.core.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.effects.slide.js"></script>
	<script type="text/javascript" language="javascript" src="js/jquery.effects.explode.js"></script>
	<script type="text/javascript" src="js/xhrUtil.js"></script>
	<script type="text/javascript" language="javascript" src="forum/replylist.js"></script>

	<script>
	$(function() {
		$( "input:button", "body" ).button();
		$( "#dialog-confirm" ).dialog({
			autoOpen: false,
			resizable: false,
			show: "slide",
			hide: "explode",
			modal:true ,
			buttons: {
				"确定": function() {
					$( this ).dialog( "close" );
					deletesure();
					return true;
				},
				"取消": function() {
					$( this ).dialog( "close" );
					return false;
				}
			}
		});
		$( "#replytopost" ).dialog({
			autoOpen: false,
			resizable: false,
	//		show: "slide",
	//		hide: "explode",
			width:700,
			height:600,
			modal:true ,
			open:function(event, ui){
				editor = KindEditor.create('#replycontent', {
					cssPath : 'kindeditor/plugins/code/prettify.css',
					uploadJson : 'kindeditor/jsp/upload_json.jsp',
					fileManagerJson : 'kindeditor/jsp/file_manager_json.jsp',
					allowFileManager : true,
					items:['undo', 'redo', '|','cut', 'copy', 'paste',
					        'plainpaste', 'wordpaste', '|','justifyleft', 'justifycenter', 'justifyright',
					        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
					        'superscript', 'quickformat', 'selectall', '|', '/',
					        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
					        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
					        'table', 'emoticons', 'map','link', 'unlink'],
		//			width:'650px',
		//			height:'480px',
					resizeType : 0
				});
			},
			beforeClose : function(event, ui) {
				// 关闭Dialog前移除编辑器
				if (editor) {
					editor.remove();
				}
			},
			buttons: {
				"回复": function() {
					$( this ).dialog( "close" );
					sureToReply();
				},
			"取消": function() {
				$( this ).dialog( "close" );
				if(editor){
					editor.html('');
				}
			}
		}
		});
		$( "#flower-confirm" ).dialog({
			autoOpen: false,
			resizable: false,
			show: "slide",
			hide: "explode",
			modal:true ,
			buttons: {
				"确定": function() {
					$( this ).dialog( "close" );
					flowersure();
					return true;
				},
				"取消": function() {
					$( this ).dialog( "close" );
					return false;
				}
			}
		});
		$( "#egg-confirm" ).dialog({
			autoOpen: false,
			resizable: false,
			show: "slide",
			hide: "explode",
			modal:true ,
			buttons: {
				"确定": function() {
					$( this ).dialog( "close" );
					eggsure();
					return true;
				},
				"取消": function() {
					$( this ).dialog( "close" );
					return false;
				}
			}
		});
	});
	</script>

	</head>
  
  <body>
<div id="wrapper">
	<div id="logo">
		<h1><a href="index.html">厦大植物检索与交流平台</a></h1>
	</div>
	<hr />
	<!-- end #logo -->
	<div id="header">
		<% 
			Integer userId = (Integer)request.getSession().getAttribute("userId");
			Integer role = (Integer)request.getSession().getAttribute("role");
		%>
		<div id="menu">
			<ul class="dropdown">
				<li><a href="index.html">首页</a>
				</li>
				<li><a>植物检索</a>
					<ul class="sub_menu">
     				   <li><a href="plantManager-showSubject.html">专题库查找</a></li>
   					   <li><a href="plantManager-kindList.html?move=0&page.currentPage=1&keOrShu=1">分等级检索</a></li>
        			   <li><a href="retrieval-toMultichannel.html">多通道检索</a></li>
					   <li><a href="plantManager-mapSearch.html">地图植物定位</a></li>
					</ul>
				</li>
   				<% if(userId != null && userId > 0 ){ %>
				<li><a>植物信息管理</a>
					<ul class="sub_menu">
     				   <li><a href="plantManager-toAddPlant.html">新增植物</a></li>
   					   <li><a href="plantManager-toAddSubject.html">新增专题</a></li>
   					    <% if( role != null && role == 3){ %>
   					   <li><a href="plant-listKindKe.html">分类管理</a></li>
   					   <%} %>
					</ul>
				</li>
   				<%} %>
				<li><a>个人植物库</a>
					<ul class="sub_menu">
   					   <% if(userId != null && userId > 0 ){ %>
        			   <li><a href="system-tomodifypwd.html">修改密码</a></li>
     				   <li><a href="user-showUserInfo.html">查看个人信息</a></li>
 				       <li><a href="user-toModifyUserInfo.html">修改个人信息</a></li>
 				       <% if(userId != null && userId > 0 && role != null && role == 3){ %>
 				       <li><a href="user-userlist.html">用户管理</a></li>
 				        <%} %>
 				       <li><a href="logout.html">退出</a></li>
 				       <%}else{ %>
     				   <li><a href="system-toLogin.html?isIntercepted=1">登录</a></li>
   					   <li><a href="system-registerinfo.html">注册</a></li>
 				        <%} %>
					</ul>
				</li>
				<li><a href="forum.html">论坛</a>
				</li>
			</ul>
		</div>
		<!-- end #menu -->
	</div>
	<!-- end #header -->
	<div id="page">
		<div id="content">
		<div id="addpost">
			<input type="button" value="发帖子"  onclick="location.href='forum-toAddPost.html?topicId=<s:property value="topicId"/>'"/>
			<input type="button" value="回复" onclick="reply(0);"/>
		</div>
			<div id="reply">
				<table class="dataTable">	
					<thead>
		 				<tr>
							<th width="20%"><span id="browseReplyNum">查看:${post.browseNumber} 回复:${post.replyNumber}</span></th>
							<th width="80%"><span id="postname">${post.postName } </span></th>
						</tr>
					</thead>
					<tbody>
						<s:iterator value="userReplys" id="reply" status="st">
						<tr>
							<td>
								<div class="user" id="">
									<div class="name">${reply.userName }</div>
									<div class="image"><img src="${reply.photo }" /></div>
									<div class="uinfo">
										鲜花（<span class="f${reply.idUser }">${reply.flower }</span>）
										鸡蛋（<span class="e${reply.idUser }">${reply.egg }</span>）
									</div>
								</div>
							</td>
							<td>
								<div class="reply">
									<div class="time">发表于${reply.replyTime }</div>
									
									<div class="content">${reply.content }</div>
									<div class="signature" >个性签名:${reply.signature }</div>
									<div class="operator">
										<input type="button" value="回复" onclick="reply(${reply.idReply });"/>
										<input type="button" value="鲜花" onclick="flower(${reply.idUser });"/>
										<input type="button" value="鸡蛋" onclick="egg(${reply.idUser });"/>
										<s:if test="#reply.isAuther == 1">
											<input type="button" value="删除" onclick="deleteReply(${reply.idReply })"/>
										</s:if>
										<s:else>
											
										</s:else>
									</div>
								</div>
							</td>
						</tr>
						</s:iterator>
					</tbody>
				</table>
				<!-- end #replytopost -->
			</div>
		</div>
		<!-- end #content -->
		<div style="clear: both;">&nbsp;</div>
		<div class="cfoot">
				<ul id="page_nav">
					<li><a onclick="pageJump(1,0);">1</a></li>
  				 	<li><a onclick="pageJump(1,-1);"><<</a></li>
  				 	<s:iterator value="pageNumber" id="page" status="st">
  				 		<s:if test="#st.first">
  				 			<li class="selected"><a onclick="pageJump(<s:property value="#page"></s:property>,0);"><s:property value="#page"></s:property></a></li>
  				 		</s:if>
  				 		<s:else>
  				 			<s:if test="#page == 0">
  				 				<li>..</li>
  				 			</s:if>
  				 			<s:else>
  				 				<li><a onclick="pageJump(<s:property value="#page"></s:property>,0);"><s:property value="#page"></s:property></a></li>
  				 			</s:else>
  				 		</s:else>
  				 		<s:if test="#st.last">
  				 			<input type="hidden" id="lastpage" value="<s:property value="#page"></s:property>"/>
  				 		</s:if>
  				 	</s:iterator>
   			 		<li><a onclick="pageJump(1,1);">>></a></li>
   			 		<li><a onclick="pageJump(<s:property value="userReplyPage.page.countPage"></s:property>,0);"><s:property value="userReplyPage.page.countPage"></s:property></a></li>
				</ul> 
		</div>
		<!-- end #cfoot -->
			<input type="hidden" id="currentPage" value="${postPage.page.currentPage}"/>
			<input type="hidden" id="countPage" value="${postPage.page.countPage}"/>
			<input type="hidden" value="<s:property value='postId'/>" id="postId"/>
			<input type="hidden" value="<s:property value='topicId'/>" id="topicId"/>
	</div>
	<!-- end #page -->
		<div id="dialog-confirm" title="确定?">
			<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>确定删除此回复？</p>
		</div>
		<!-- end #dialog-confirm -->
		<div id="replytopost" title="回复帖子">
			<form id="replyForm" action="forum-replyPost.html" method="post">
				<textarea id="replycontent" name="userReply.content"></textarea>
				<input type="hidden" id="RtopicId" value="<s:property value='topicId'/>" name="topicId"/>
				<input type="hidden" id="RpostId" value="<s:property value='postId'/>" name="postId"/>
				<input type="hidden" id="Rreplyto" value="0" name="replyTo"/>
			</form>
		</div>
		<!-- end #replytopost -->
		<div id="flower-confirm" title="送鲜花">
			<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>
				我非常同意你的观点，送朵鲜花鼓励一下
			</p>
		</div>
		<!-- end #flower-confirm -->
		<div id="egg-confirm" title="砸鸡蛋">
			<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>
				我非常不同意你的观点，砸个鸡蛋反对一下
			</p>
		</div>
		<!-- end #egg-confirm -->
	<div id="footer">
		<p>
		<a href="index.html">返回首页</a>|
            Copyright &copy; 2012 厦门大学软件学院</p>
	</div>
	<!-- end #footer -->
</div>
</body>
</html>
